﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Libs.Content;

public partial class Controls_Right_TopHit : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        NewsWeb _NewsWeb = new NewsWeb();
        rptList.DataSource = _NewsWeb.GetTopView(DateTime.Today.AddDays(-7), 5);
        rptList.DataBind();
    }

    protected string GetHtml(string _Title, string _Lead, string _Url, string _ImageUrl, DateTime _PublishedTime)
    {
        string s;
        if (_ImageUrl.Length > 0)
        {
            s = Resources.Html.EntertainmentImg;
            s = s.Replace("$ImageUrl$", AppUtils.ImageUrl(_ImageUrl, "66", "48"));
        }
        else
        {
            s = Resources.Html.Entertainment;
        }
        s = s.Replace("$Link$", _Url);
        s = s.Replace("$Title$", _Title);
        return s;
    }
}